package nsip.scheduling;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import nsip.model.Item;

/**
 *
 * @author Markus Goetz
 */
public class SeedSchedule extends AbstractSchedule {
    
    /**
     *
     * @param overplanRatio amount of relative overbooking (e.g. 1.50) of available cycles 
     * @param currentDay
     * @param random
     */
    public SeedSchedule(double overplanRatio, int currentDay, Random random) {
        super(overplanRatio, currentDay, random);
    }

    public void placeOrder(Item order) {
        List<Day> productionDays = getProductionDays(order, false, true);

        if (productionDays.isEmpty()) {
            throw new IllegalStateException("Could not place " + order);
        }

        Day day = productionDays.get(random.nextInt(productionDays.size()));
        day.place(order);
    }
}
